<!--
 * @Description:  第十四章 父子组件传参
 * @Author: IA ia@kepro.space
 * @Date: 2025-02-15 15:10:18
-->
<template>
  <div>
    <p>第十四章 父子组件传参</p>
    <div>
      <p>父级</p>
      <waterFallVue1
        :title1="title1"
        :arr="[1, 2, 3]"
        @on-click="getName"
        ref="waterFall"
      ></waterFallVue1>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import waterFallVue1 from '@/components/14th/water-fall-1.vue'

let title1 = 'IA title1'

const getName = (name: string) => {
  console.log('子向父传的值： ', name)
}

const waterFall = ref<InstanceType<typeof waterFallVue1>>()

console.log('子组件向父组件暴露的属性：', waterFall.value?.name)
console.log('子组件向父组件暴露的方法：', waterFall.value?.open)
</script>
<style scoped></style>
